package com.learn.bean;

import org.apache.flink.table.api.Schema;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;


public class DWMBean {

    String vin;
    String energysyscode;
    String vehicleseries;
    String company;
    Long platformtime;
    Long sampletime;
    String platformtimedatetime;
    String sampletimedatetime;
    String alarminsulationalarm;
    String alarmsoctransition;
    String soc;
    String alarmhighvoltageinterlockedstate;
    String maxvoltagecellserial;
    String maxcellvoltage;
    String alarmsoc2high;
    String alarmenergystoragemismatch;
    String operationmode;
    String alarmenergystorageundervoltage;
    String maxtempsysserial;
    String dcdc;
    String isdrivepower;
    String energysystempcount;
    String energysyscount;
    String alarmmotorcount;
    String cmd_vehdatadecount;
    String voltagetempdistance;
    String braking;
    String mileage;
    String longitude;
    String minvoltagesysserial;
    String alarmsoc2low;
    String alarmmotortemp;
    String alarmbattemp2high;
    String alarmhydrogensafetymonitoringsystemstate;
    String longstate;
    String alarmdcdcstatealarm;
    String resistance;
    String maxtempprobeserial;
    String alarmenergystorageovervoltage;
    String alarmcellundervoltage;
    String alarmothercount;
    String gear;
    String alarmcellovervoltage;
    String pecelerationpedal;
    String motorcount;
    String latitude;
    String alarmcommonflg;
    String alarmenginedata;
    String acceleratorpedal;
    String alarmotherdata;
    String speed;
    String alarmdcdctempalarm;
    String valid;
    String mincellvoltage;
    String current;
    String alarmrechargdevdata;
    String minvoltagecellserial;
    String alarmmaxalarmlevel;
    String alarmenergystorageovercharge;
    String alarmmotordata;
    String chargestate;
    String alarmrechargdevcount;
    String mintemp;
    String mintempprobeserial;
    String alarmmotorcontroltemp;
    String mintempsysserial;
    String maxtemp;
    String alarmtempdiff;
    String tempdistance;
    String latstate;
    String alarmenginecount;
    String maxvoltagesysserial;
    String command;
    String voltage;
    String vehiclestate;
    String alarmcellconsistencypool;
    String gearenum;
    String alarmbrakingsystemalarm;
    String energysysstartcellserial;
    String energysysvoltage;
    String energysyscurrent;
    String energysysframecellcount;
    String energysysserial;
    String energysyscellcount;
    String energysystempserial;
    String energysystempprobecount;
    String motorstate;
    String controlcurrent;
    String motorserial;
    String motortorque;
    String controlvoltage;
    String rotatingspeed;
    String motortemp;
    String motorcontroltemp;
    String energysystempdatalist;
    String energysyscellvoltagelist;
    String cell_voltage_1;
    String cell_voltage_2;
    String cell_voltage_3;
    String cell_voltage_4;
    String cell_voltage_5;
    String cell_voltage_6;
    String cell_voltage_7;
    String cell_voltage_8;
    String cell_voltage_9;
    String cell_voltage_10;
    String cell_voltage_11;
    String cell_voltage_12;
    String cell_voltage_13;
    String cell_voltage_14;
    String cell_voltage_15;
    String cell_voltage_16;
    String cell_voltage_17;
    String cell_voltage_18;
    String cell_voltage_19;
    String cell_voltage_20;
    String cell_voltage_21;
    String cell_voltage_22;
    String cell_voltage_23;
    String cell_voltage_24;
    String cell_voltage_25;
    String cell_voltage_26;
    String cell_voltage_27;
    String cell_voltage_28;
    String cell_voltage_29;
    String cell_voltage_30;
    String cell_voltage_31;
    String cell_voltage_32;
    String cell_voltage_33;
    String cell_voltage_34;
    String cell_voltage_35;
    String cell_voltage_36;
    String cell_voltage_37;
    String cell_voltage_38;
    String cell_voltage_39;
    String cell_voltage_40;
    String cell_voltage_41;
    String cell_voltage_42;
    String cell_voltage_43;
    String cell_voltage_44;
    String cell_voltage_45;
    String cell_voltage_46;
    String cell_voltage_47;
    String cell_voltage_48;
    String cell_voltage_49;
    String cell_voltage_50;
    String cell_voltage_51;
    String cell_voltage_52;
    String cell_voltage_53;
    String cell_voltage_54;
    String cell_voltage_55;
    String cell_voltage_56;
    String cell_voltage_57;
    String cell_voltage_58;
    String cell_voltage_59;
    String cell_voltage_60;
    String cell_voltage_61;
    String cell_voltage_62;
    String cell_voltage_63;
    String cell_voltage_64;
    String cell_voltage_65;
    String cell_voltage_66;
    String cell_voltage_67;
    String cell_voltage_68;
    String cell_voltage_69;
    String cell_voltage_70;
    String cell_voltage_71;
    String cell_voltage_72;
    String cell_voltage_73;
    String cell_voltage_74;
    String cell_voltage_75;
    String cell_voltage_76;
    String cell_voltage_77;
    String cell_voltage_78;
    String cell_voltage_79;
    String cell_voltage_80;
    String cell_voltage_81;
    String cell_voltage_82;
    String cell_voltage_83;
    String cell_voltage_84;
    String cell_voltage_85;
    String cell_voltage_86;
    String cell_voltage_87;
    String cell_voltage_88;
    String cell_voltage_89;
    String cell_voltage_90;
    String cell_voltage_91;
    String cell_voltage_92;
    String cell_voltage_93;
    String cell_voltage_94;
    String cell_voltage_95;
    String cell_voltage_96;
    String cell_voltage_97;
    String cell_voltage_98;
    String cell_voltage_99;
    String cell_voltage_100;
    String cell_voltage_101;
    String cell_voltage_102;
    String cell_voltage_103;
    String cell_voltage_104;
    String cell_voltage_105;
    String cell_voltage_106;
    String cell_voltage_107;
    String cell_voltage_108;
    String cell_voltage_109;
    String cell_voltage_110;
    String cell_voltage_111;
    String cell_voltage_112;
    String cell_voltage_113;
    String cell_voltage_114;
    String cell_voltage_115;
    String cell_voltage_116;
    String cell_voltage_117;
    String cell_voltage_118;
    String cell_voltage_119;
    String cell_voltage_120;
    String cell_voltage_121;
    String cell_voltage_122;
    String cell_voltage_123;
    String cell_voltage_124;
    String cell_voltage_125;
    String cell_voltage_126;
    String cell_voltage_127;
    String cell_voltage_128;
    String cell_voltage_129;
    String cell_voltage_130;
    String cell_voltage_131;
    String cell_voltage_132;
    String cell_voltage_133;
    String cell_voltage_134;
    String cell_voltage_135;
    String cell_voltage_136;
    String cell_voltage_137;
    String cell_voltage_138;
    String cell_voltage_139;
    String cell_voltage_140;
    String cell_voltage_141;
    String cell_voltage_142;
    String cell_voltage_143;
    String cell_voltage_144;
    String cell_voltage_145;
    String cell_voltage_146;
    String cell_voltage_147;
    String cell_voltage_148;
    String cell_voltage_149;
    String cell_voltage_150;
    String cell_voltage_151;
    String cell_voltage_152;
    String cell_voltage_153;
    String cell_voltage_154;
    String cell_voltage_155;
    String cell_voltage_156;
    String cell_voltage_157;
    String cell_voltage_158;
    String cell_voltage_159;
    String cell_voltage_160;
    String cell_voltage_161;
    String cell_voltage_162;
    String cell_voltage_163;
    String cell_voltage_164;
    String cell_voltage_165;
    String cell_voltage_166;
    String cell_voltage_167;
    String cell_voltage_168;
    String cell_voltage_169;
    String cell_voltage_170;
    String cell_voltage_171;
    String cell_voltage_172;
    String cell_voltage_173;
    String cell_voltage_174;
    String cell_voltage_175;
    String cell_voltage_176;
    String cell_voltage_177;
    String cell_voltage_178;
    String cell_voltage_179;
    String cell_voltage_180;
    String cell_voltage_181;
    String cell_voltage_182;
    String cell_voltage_183;
    String cell_voltage_184;
    String cell_voltage_185;
    String cell_voltage_186;
    String cell_voltage_187;
    String cell_voltage_188;
    String cell_voltage_189;
    String cell_voltage_190;
    String cell_voltage_191;
    String cell_voltage_192;
    String cell_voltage_193;
    String cell_voltage_194;
    String cell_voltage_195;
    String cell_voltage_196;
    String cell_voltage_197;
    String cell_voltage_198;
    String cell_voltage_199;
    String cell_voltage_200;
    String serial_temp_1;
    String serial_temp_2;
    String serial_temp_3;
    String serial_temp_4;
    String serial_temp_5;
    String serial_temp_6;
    String serial_temp_7;
    String serial_temp_8;
    String serial_temp_9;
    String serial_temp_10;
    String serial_temp_11;
    String serial_temp_12;
    String serial_temp_13;
    String serial_temp_14;
    String serial_temp_15;
    String serial_temp_16;
    String serial_temp_17;
    String serial_temp_18;
    String serial_temp_19;
    String serial_temp_20;
    String serial_temp_21;
    String serial_temp_22;
    String serial_temp_23;
    String serial_temp_24;
    String serial_temp_25;
    String serial_temp_26;
    String serial_temp_27;
    String serial_temp_28;
    String serial_temp_29;
    String serial_temp_30;
    String serial_temp_31;
    String serial_temp_32;
    String serial_temp_33;
    String serial_temp_34;
    String serial_temp_35;
    String serial_temp_36;
    String serial_temp_37;
    String serial_temp_38;
    String serial_temp_39;
    String serial_temp_40;
    String serial_temp_41;
    String serial_temp_42;
    String serial_temp_43;
    String serial_temp_44;
    String serial_temp_45;
    String serial_temp_46;
    String serial_temp_47;
    String serial_temp_48;
    String serial_temp_49;
    String serial_temp_50;

    public static Schema schema(){

        Map<Class,String> map = new HashMap<>();
        map.put(String.class,"STRING");
        map.put(Integer.class,"INT");
        map.put(Long.class,"BIGINT");

        Schema.Builder builder = Schema.newBuilder();

        Field[] fields = TestBean.class.getDeclaredFields();

        for (Field field : fields) {
            builder.column(field.getName(),map.get(field.getType()));
        }

        return builder.build();

    }

}
